﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManagePartner.ascx.cs"
    Inherits="NLLSite.Administrator.UserControl.ManagePartner" %>

<script type="text/javascript" src="../../ckfinder/ckfinder.js"></script>
<script type="text/javascript">

    function BrowseServer() {
        // You can use the "CKFinder" class to render CKFinder in a page:
        var finder = new CKFinder();
        finder.basePath = '../../ckfinder/'; // The path for the installation of CKFinder (default = "/ckfinder/").
        finder.selectActionFunction = SetFileField;
        finder.popup();

        // It can also be done in a single line, calling the "static"
        // popup( basePath, width, height, selectFunction ) function:
        // CKFinder.popup( '../', null, null, SetFileField ) ;
        //
        // The "popup" function can also accept an object as the only argument.
        // CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
    }

    // This is a sample function which is called when a file is selected in CKFinder.
    function SetFileField(fileUrl) {
        document.getElementById('ManagePartner1_TxtimgLink').value = fileUrl;
        //Element ID = Ten class usercontrol + 1 + ID cua text box.
    }

</script>
<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý đối tác</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <table>
                    <tr>
                        <td>
                            <asp:Panel ID="Panel1" runat="server">
                                <table>
                                    <tr>
                                        <td>
                                            Link Ảnh :
                                        </td>
                                        <td class="style4">
                                            <asp:TextBox ID="TxtimgLink" runat="server" Width="300px"></asp:TextBox>
                                            <input type="button" value="Browse" onclick="BrowseServer();" style="width: 89px" class="altbutton" />
                                        </td>
                                        <td>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtimgLink"
                                                ErrorMessage="*"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Linh Banner :
                                        </td>
                                        <td class="style4">
                                            <asp:TextBox ID="TxtBanLink" runat="server" Width="300px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtBanLink"
                                                ErrorMessage="*"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td class="style4">
                                            <asp:Label ID="LblCheck" runat="server"></asp:Label>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style2">
                                            &nbsp;
                                        </td>
                                        <td class="style4">
                                            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Cập Nhật" 
                                                CssClass="altbutton" />
                                            &nbsp;
                                            <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" 
                                                Text="Thiết Lập Lại" CssClass="altbutton" />
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Panel ID="Panel2" runat="server">
                                <asp:CheckBox ID="Cbxdele" runat="server" 
                                    OnCheckedChanged="Cbxdele_CheckedChanged" AutoPostBack="True" />
                                &nbsp;<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Xóa"
                                    OnClientClick="javascript:return confirm('Bạn có muốn xóa?')" 
                                    CssClass="altbutton" />
                                &nbsp;<asp:Button ID="Button4" runat="server" Text="Thêm mới" 
                                    CssClass="altbutton" PostBackUrl="~/Administrator/ThemDoiTac.aspx" />
                                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                    DataKeyNames="ID" DataSourceID="LinqDataSource1" EnableModelValidation="True"
                                    GridLines="None" AllowPaging="True" 
                                    OnSelectedIndexChanged="GridView1_SelectedIndexChanged" Width="920px" 
                                    AllowSorting="True" ForeColor="#333333">
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="Cbx" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                                            SortExpression="ID" Visible="False" />
                                        <asp:BoundField DataField="ImageUrl" HeaderText="Link Ảnh" 
                                            SortExpression="ImageUrl" >
                                        <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Link" HeaderText="Link Banner" 
                                            SortExpression="Link" >
                                        <ItemStyle HorizontalAlign="Left" />
                                        </asp:BoundField>
                                        <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                                    </Columns>
                                    <EditRowStyle BackColor="#999999" />
                                    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                                        HorizontalAlign="Left" />
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                </asp:GridView>
                                <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DAL_Class.NLLDataContext"
                                    TableName="Partners">
                                </asp:LinqDataSource>
                            </asp:Panel>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
